<template>
    <div>
        <md-dialog
            v-model="phoneHidden" :closable="show_closable"
            :title="title"
            :btns="[{
                        text: this.confirmText,
                        handler: this.dialogConfirm,
          }]"
        >
            <slot>

            </slot>
        </md-dialog>
    </div>
</template>

<script>
    import {Dialog, Button, Toast} from 'mand-mobile'
    export default {
        components: {
            [Dialog.name]: Dialog,
        },
        props: {
            dialog_hidden: {
                type: Boolean,
                default() {
                    return true
                }
            },
            show_cancel: {
                type: Boolean,
                default() {
                    return false
                }
            },
            confirmText: {
                type: String,
                default() {
                    return '确定'
                }
            },
            title: {
                type: String,
                default() {
                    return ''
                }
            },
            show_closable: {
                type: Boolean,
                default() {
                    return false
                }
            }
        },
        data() {
            return {
                showCancel: false,
                phoneHidden: !this.dialog_hidden,
            }
        },
        methods: {
            dialogConfirm() {
                this.$emit('confirmEvent')
            }
        },
        watch: {
            dialog_hidden: {
                handler(val) {
                    this.phoneHidden = !val
                    console.log(val, 'val')
                },
                deep: true
            },
        }
    }
</script>
<style>

</style>
